home *** CD-ROM | disk | FTP | other *** search
/ Geek Games #12 / GEGA012.iso / Jogos de Azar / fruit.swf / scripts / C_GoldCoinsMenuCLASS.as < prev    next >
Text File  |  2006-01-17  |  2KB  |  78 lines

  1. _global.C_GoldCoinsMenuCLASS = function()
  2. {
  3.    this.init();
  4. };
  5. C_GoldCoinsMenuCLASS.prototype = new MovieClip();
  6. C_GoldCoinsMenuCLASS.prototype.init = function()
  7. {
  8.    this.stop();
  9.    if(!this._coins)
  10.    {
  11.       this._coins = 1;
  12.    }
  13.    this.setCoins(this._coins);
  14.    var b;
  15.    var i = 1;
  16.    while(i <= this.max)
  17.    {
  18.       b = this["c" + i + "_btn"];
  19.       b.n = i;
  20.       b.onPress = function()
  21.       {
  22.          this._parent.setCoins(this.n);
  23.          this._parent.doOut();
  24.       };
  25.       b.onRollOver = function()
  26.       {
  27.          var o = this._parent;
  28.          var h = o.hints[this.n];
  29.          o.doOver();
  30.          if(h != undefined)
  31.          {
  32.             o.showAlt(h);
  33.          }
  34.       };
  35.       b.onDragOut = b.onRollOut = function()
  36.       {
  37.          this._parent.hideAlt();
  38.          this._parent.doOut();
  39.       };
  40.       i++;
  41.    }
  42.    var o = {};
  43.    o[1] = "Bet ONE coin";
  44.    o[2] = "Bet TWO coins";
  45.    o[3] = "Bet TREE coins";
  46.    o[4] = "Bet FOUR coins";
  47.    o[5] = "Bet FIVE coins";
  48.    this.setHints(o);
  49. };
  50. C_GoldCoinsMenuCLASS.prototype.setCoins = function(c)
  51. {
  52.    if(c < 0 || c > this.max)
  53.    {
  54.       return false;
  55.    }
  56.    delete this["c" + this._coins + "_btn"].enabled;
  57.    this["c" + c + "_btn"].enabled = false;
  58.    this.gotoAndStop("coin_" + c);
  59.    this._coins = c;
  60.    this.client.client[this.client.handler](c,this);
  61.    return true;
  62. };
  63. C_GoldCoinsMenuCLASS.prototype.setHints = function(h)
  64. {
  65.    this.hints = h;
  66. };
  67. C_GoldCoinsMenuCLASS.prototype.setChangeHandler = function(client, handler)
  68. {
  69.    this.client = {client:client,handler:handler};
  70. };
  71. C_GoldCoinsMenuCLASS.prototype.addProperty("coins",function()
  72. {
  73.    return this._coins;
  74. }
  75. ,C_GoldCoinsMenuCLASS.prototype.setCoins);
  76. ASSetPropFlags(_global,"C_GoldCoinsMenuCLASS",131);
  77. Object.registerClass("C_GoldCoinsMenuCLASS",C_GoldCoinsMenuCLASS);
  78.